// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/utils/request'


//AddBanner
export function AddBanner(data) {
  return request({
    url: '/admin/banner/save',
    method: 'POST',
    data
  })
}

//UpdateBanner
export function UpdateBanner(data) {
  return request({
    url: '/admin/banner/update',
    method: 'POST',
    data
  })
}



//UpdateBanner
export function UpdatePorcelainArea(data) {
  return request({
    url: '/admin/porcelainArea/update',
    method: 'POST',
    data
  })
}




export function InfoBanner(params) {
  return request({
    url: `/admin/banner/info`,
    method: 'GET',
    params
  })
}




/**
 * 删除banner
 * @param pram
 */
export function bannerDeleteApi(id) {
  return request({
    url: `/admin/banner/delete/${id}`,
    method: 'get'
  })
}

/**
 * 商品列表 表头数量
 */
export function bannerHeadersApi() {
  return request({
    url: '/admin/banner/tabs/headers',
    method: 'GET'
  })
}

/**
 * banner列表
 * @param pram
 */
export function bannerListApi(params) {
  return request({
    url: '/admin/banner/list',
    method: 'GET',
    params
  })
}

export function ListMyIconApi(params) {
  return request({
    url: '/admin/banner/myIcon/list',
    method: 'GET',
    params
  })
}

//myIconEnableApi
export function myIconEnableApi(data) {
  return request({
    url: '/admin/banner/myIcon/showOrHide',
    method: 'POST',
    data
  })
}
export function porcelainAreaApi(params) {
  return request({
    url: '/admin/banner/porcelainArea/list',
    method: 'GET',
    params
  })
}



/**
 * 显示
 * @param pram
 */
export function displayApi(id) {
  return request({
    url: `/admin/banner/display/${id}`,
    method: 'GET'
  })
}
/**
 * 隐藏
 * @param pram
 */
export function hideApi(id) {
  return request({
    url: `/admin/banner/hide/${id}`,
    method: 'GET'
  })
}

export function jingangAreaApi(params) {
  return request({
    url: '/admin/banner/jingangArea/list?_t=' + new Date().getTime(),
    method: 'GET',
    params
  })
}

export function SaveJInggangArea(data) {
  return request({
    url: '/admin/banner/jingangArea/save',
    method: 'POST',
    data
  })
}
